const Router = require("koa-router");
const topic = new Router();
const {
    Create,
    Detail,
    List,
    Update,
    FollowingTopicUsers,
} = require("../controller/topic");
const auth = require("../middleware/auth");

// 获取话题列表
topic.get("/", List);
// 获取话题详情
topic.get("/:id", Detail);
// 创建话题
topic.post("/", auth, Create);
// 更新话题
topic.patch("/:id", auth, Update);
// 话题关注列表
topic.get("/:id/followers", FollowingTopicUsers);

module.exports = topic;
